﻿using System.Windows;
using Kiva7.Controls;
using Kiva7.DataRequests;

namespace Kiva7.Pages
{
    public partial class LenderControl : BaseUserControl
    {
        public LenderControl()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.DoNavigate(LoansPage.PageUrl);
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            LenderRequest lender = DataContext as LenderRequest;

            if (lender != null
                && lender.SingleData != null
                && lender.SingleData.Image != null)
            {
                DoNavigate(FullImagePage.GetPageUrl(lender.SingleData.Image.Id));
            }


            //WebBrowserTask task = new WebBrowserTask();
            //task.URL = string.Format("http://www.kiva.org/lender/{0}", LenderID.Text);
            //task.Show();
        }

        internal void TranslateTextWithDetect()
        {
            tbkOccupationalInfo.TranslateTextWithDetect();
            tbkLoanBecause.TranslateTextWithDetect();
        }
    }
}
